import { RouteRecordRaw, RouterView } from 'vue-router'

const routes: RouteRecordRaw = {
  path: 'cms',
  component: RouterView,
  meta: {
    title: '内容'
  },
  children: [
    {
      path: 'article/index',
      name: 'article-list',
      component: () => import('@/views/cms/article/list/index.vue'),
      meta: {
        // 自定义路由元数据
        title: '文章列表'
      }
    },
    {
      path: 'article/add_article',
      name: 'article-add',
      component: () => import('@/views/cms/article/add-edit/index.vue'),
      meta: {
        title: '添加文章'
      }
    },
    {
      path: 'edit_article/:id',
      name: 'article-edit',
      component: () => import('@/views/cms/article/add-edit/index.vue'),
      props: true,
      meta: {
        title: '编辑文章'
      }
    },
    {
      path: 'article_category/index',
      name: 'article-category',
      component: () => import('@/views/cms/category/index.vue'),
      meta: {
        title: '商品分类'
      }
    }
  ]
}

export default routes
